/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author superMan
* @date 2021-03-30
**/
@Entity
@Data
@Table(name="variety_store_user")
public class VarietyStoreUser implements Serializable {

    @Id
    @Column(name = "user_id")
    @ApiModelProperty(value = "用户Id")
    private Long userId;

    @Column(name = "user_nickname")
    @ApiModelProperty(value = "用户昵称")
    private String userNickname;

    @Column(name = "user_password")
    @ApiModelProperty(value = "用户密码")
    private String userPassword;

    @Column(name = "user_email")
    @ApiModelProperty(value = "用户邮箱")
    private String userEmail;

    @Column(name = "acti_state")
    @ApiModelProperty(value = "激活状态，0表示未激活，1表示激活")
    private Integer actiState;

    @Column(name = "email_token_exptime")
    @ApiModelProperty(value = "用于判断邮箱链接有效时间")
    private Timestamp emailTokenExptime;

    public void copy(VarietyStoreUser source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}